# -*- coding:utf-8 -*-
import sys

import IPy
cidr_list = ['9.135.64.0/20', '9.135.128.0/20', '9.135.192.0/21', '9.135.200.0/21',
             '9.135.184.0/21', '9.135.208.0/21', '9.135.160.0/20', '9.135.16.0/20', '9.134.96.0/21', '9.134.16.0/20','9.134.0.0/20','9.134.50.0/23','9.134.52.0/22','9.134.64.0/20','9.134.112.0/20','9.134.232.0/21','9.134.184.0/21','9.135.8.0/21','9.135.88.0/21','9.135.96.0/21','9.135.144.0/22','9.135.32.0/22','9.134.56.0/21','9.134.48.0/23','9.134.90.0/23','9.135.0.0/24','9.135.1.0/24','9.135.5.0/24','9.135.4.0/25','9.135.4.128/25','9.134.128.0/21','9.134.144.0/21','9.134.140.0/24','9.134.141.0/24','9.134.153.0/26','9.134.153.64/26','9.134.192.0/21','9.134.208.0/21','9.134.216.0/22','9.134.204.0/24','9.134.205.0/24']
ip_mapto_name = {
    '9.135.64.0/20': 'landun_c1_gz4_9.135.80.28',
    '9.135.128.0/20': 'landun_c2_gz4_9.135.176.2',
    '9.135.192.0/21': 'landun_c3_g_gz4_9.135.41.3',
    '9.135.200.0/21': 'landun_c4_g_gz3_9.135.42.45',
    '9.135.184.0/21': 'pcg_c1_gz3_9.135.182.5',
    '9.135.208.0/21': 'pcg_c2_g_gz3_9.135.216.6',
    '9.135.160.0/20': 'tkestack_user1_gz3_9.135.180.5',
    '9.135.16.0/20': 'tkestack_user2_gz4_9.134.178.7',
    '9.134.96.0/21': 'stke_user1_gz3_9.134.90.10',
    '9.134.16.0/20': 'stke_user2_gz4_9.134.56.23',
    '9.134.0.0/20': 'GZ-4-CVM-01CVM',
    '9.134.50.0/23': 'GZ-4-CVM-02CVM',
    '9.134.52.0/22': 'GZ-4-CVM-03CVM',
    '9.134.64.0/20': 'GZ-3-CVM-01CVM',
    '9.134.112.0/20': 'GZ-3-CVM-02CVM',
    '9.134.232.0/21': 'GZ-4-CVM-05cvm',
    '9.134.184.0/21': 'GZ-5-CVM-01CVM',
    '9.135.8.0/21': 'GZ-3-CVM-03CVM',
    '9.135.88.0/21': 'GZ-4-CVM-07CVM',
    '9.135.96.0/21': 'GZ-3-CVM-04CVM',
    '9.135.144.0/22': 'GZ-4-CVM-08CVM',
    '9.135.32.0/22': 'GZ-4-CVM-06导流测试验证，完成后可转cvm用',
    '9.134.56.0/21': 'GZ-4-MCVM-01常规 node',
    '9.134.48.0/23': 'GZ-4-AGENT-01agent集群验证',
    '9.134.90.0/23': 'GZ-3-MCVM-02常规 node',
    '9.135.0.0/24': 'SH-2-CVM-01CVM',
    '9.135.1.0/24': 'SH-6-CVM-02CVM',
    '9.135.5.0/24': 'SH-4-GPU-01GPU',
    '9.135.4.0/25': 'SH-2-BACK-01回退',
    '9.135.4.128/25': 'SH-6-BACK-01回退',
    '9.134.128.0/21': 'NJ-1-CVM-01CVM',
    '9.134.144.0/21': 'NJ-2-CVM-01CVM',
    '9.134.140.0/24': 'NJ-1-MCVM-01常规node',
    '9.134.141.0/24': 'NJ-1-TESTNODE-01测试node',
    '9.134.153.0/26': 'NJ-1-G6-NODE-01G6开发node',
    '9.134.153.64/26': 'NJ-1-G6-NODE-02G6用户node',
    '9.134.192.0/21': 'TJ-1-CVM-01CVM',
    '9.134.208.0/21': 'TJ-2-CVM-01CVM',
    '9.134.216.0/22': 'TJ-1-CVM-02CVM',
    '9.134.204.0/24': 'TJ-1-MCVM-01常规node',
    '9.134.205.0/24': 'TJ-1-APP-01全流量灰度'
}
for ip in sys.argv[1:]:
    ip = ip.strip()
    if not ip:
        continue
    for cidr in cidr_list:
        if ip in IPy.IP(cidr):
            print(ip_mapto_name[cidr])
            break